%%%-------------------------------------------------------------------
%%% @author kk
%%% @copyright (C) 2024, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 18. 7月 2024 12:16
%%%-------------------------------------------------------------------
-module(caseyuju).
-author("kk").

%% API
-export([area/1, start/0]).

area(Shape) ->
  case Shape of
    {circle, Radius} ->
      Radius * Radius * math:pi();
    {square, Side} ->
      Side * Side;
    _ ->
      error("未匹配")
  end.

start() ->
  Area = area({square, 2}),
  io:fwrite("~w", [Area]).